#include <cstdio>

char queue[60];

int main(){
    //freopen("in.txt","r",stdin);
    int num,sec;
    scanf("%d%d",&num,&sec);
    scanf("%s",queue);
    int i=num-1;
    while(i>=0){
        if (queue[i] == 'B' && queue[i+1]=='G'){
            char tmp;
            for (int j=0; j < sec && i+j <num-1 ;j=j+1){
                tmp=queue[i+j];
                queue[i+j]=queue[i+j+1];
                queue[i+j+1]=tmp;
            }
            i=i-sec-1;
        }
        else
            i--;
    }
    printf("%s",queue);
}
